function save_json(filename,path,t,x)
if(length(t) ~= length(x))
return
end

current_dir=pwd;

cd(path);
fid = fopen(filename,'w');

fprintf(fid,'%s=[[%e,%e]',strrep(filename,'.','_'),t(1),x(1));
fprintf(fid,',[%e,%e]', horzcat(t(2:length(t)),x(2:length(t)))' );
fprintf(fid,']');

fclose(fid);
cd(current_dir);
